package object;

public class EqualsDemo {
    public static void main(String[] args) {
        Point p1 = new Point(1, 2);
        Point p2 = new Point(1, 2);
        System.out.println(p1==p2);

        String s1="hello";
        String s2="hello";
        System.out.println(s1==s2);
        System.out.println(s1.equals(s2));

        String s3=new String("hello");
        String s4=new String("hello");
        System.out.println(s3==s4);
        System.out.println(s3.equals(s4));

        StringBuilder s5=new StringBuilder("hello");
        StringBuilder s6=new StringBuilder("hello");
        System.out.println(s5==s6);
        System.out.println(s5.equals(s6));
    }
}
